package com.hxzy.boot.mapper.impl;

import com.hxzy.boot.mapper.UserMapper;
import com.hxzy.boot.pojo.User;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wzm
 * @create 2023-09-25 11:46
 * project_name:javaweb2308
 */
//Mapper实现
//@Component //将UserMapperImpl对象交给IOC容器管理
@Repository
public class UserMapperImpl implements UserMapper {
    @Override
    public List<User> selectByAll() {
        //模拟在数据库查询到了一个集合
        //对象
        User user = new User();
        user.setName("张三");
        user.setAge(15);
        user.setAddress("昆明");

        //对象
        User user1 = new User();
        user1.setName("李四");
        user1.setAge(18);
        user1.setAddress("昆明");

        List<User> list = new ArrayList<>();
        list.add(user);
        list.add(user1);

        return list;
    }
}
